#include "StdAfx.h"
#include "DDSvrNetCfg.h"

DDSvrNetCfg::DDSvrNetCfg(void)
{
	memset(this,0,sizeof(*this));
}

DDSvrNetCfg::~DDSvrNetCfg(void)
{
}

BOOL DDSvrNetCfg::CheckCallBack()
{
	if( NULL == m_xCheckUser.funCallBack ||
		NULL == m_xCheckUserRight.funCallBack ||
		NULL == m_xSetConfig.funCallBack ||
		NULL == m_xGetConfig.funCallBack ||
		NULL == m_xStartSearch.funCallBack ||
		NULL == m_xStopSearch.funCallBack ||
		NULL == m_xfwOpen.funCallBack ||
		NULL == m_xfWrite.funCallBack ||
		NULL == m_xfwClose.funCallBack ||
		NULL == m_xfrOpen.funCallBack ||
		NULL == m_xfRead.funCallBack ||
		NULL == m_xfrClose.funCallBack )
	{
		return FALSE;
	}

	return TRUE;
}

int DDSvrNetCfg::RegCheckUserCallBack(SvrNetCheckUserCBFun funCallBack,void *pContext)
{
	m_xCheckUser.funCallBack = funCallBack;
	m_xCheckUser.pContext    = pContext;

	return DD_ERR_SUCCESS;
}

int DDSvrNetCfg::RegCheckUserRightCallBack(SvrNetCheckUserRightCBFun funCallBack,void *pContext)
{
	m_xCheckUserRight.funCallBack = funCallBack;
	m_xCheckUserRight.pContext    = pContext;

	return DD_ERR_SUCCESS;
}

int DDSvrNetCfg::RegSetConfigCallBack(SvrNetSetConfigCBFun funCallBack,void *pContext)
{
	m_xSetConfig.funCallBack = funCallBack;
	m_xSetConfig.pContext    = pContext;

	return DD_ERR_SUCCESS;
}

int DDSvrNetCfg::RegGetConfigCallBack(SvrNetGetConfigCBFun funCallBack,void *pContext)
{
	m_xGetConfig.funCallBack = funCallBack;
	m_xGetConfig.pContext    = pContext;

	return DD_ERR_SUCCESS;
}



int DDSvrNetCfg::RegStartSearchCallBack(SvrNetStartSearchCBFun funCallBack,void *pContext)
{
	m_xStartSearch.funCallBack = funCallBack;
	m_xStartSearch.pContext    = pContext;

	return DD_ERR_SUCCESS;
}

int DDSvrNetCfg::RegStopSearchCallBack(SvrNetStopSearchCBFun funCallBack,void *pContext)
{
	m_xStopSearch.funCallBack = funCallBack;
	m_xStopSearch.pContext    = pContext;

	return DD_ERR_SUCCESS;
}

int DDSvrNetCfg::RegfwOpenCallBack(SvrNetfwOpenCBFun funCallBack,void *pContext)
{
	m_xfwOpen.funCallBack = funCallBack;
	m_xfwOpen.pContext    = pContext;

	return DD_ERR_SUCCESS;
}
int DDSvrNetCfg::RegfWriteCallBack(SvrNetfWriteCBFun funCallBack,void *pContext)
{
	m_xfWrite.funCallBack = funCallBack;
	m_xfWrite.pContext    = pContext;

	return DD_ERR_SUCCESS;
}
int DDSvrNetCfg::RegfwCloseCallBack(SvrNetfwCloseCBFun funCallBack,void *pContext)
{
	m_xfwClose.funCallBack = funCallBack;
	m_xfwClose.pContext    = pContext;

	return DD_ERR_SUCCESS;
}

int DDSvrNetCfg::RegfrOpenCallBack(SvrNetfrOpenCBFun funCallBack,void *pContext)
{
	m_xfrOpen.funCallBack = funCallBack;
	m_xfrOpen.pContext    = pContext;

	return DD_ERR_SUCCESS;
}
int DDSvrNetCfg::RegfReadCallBack(SvrNetfReadCBFun funCallBack,void *pContext)
{
	m_xfRead.funCallBack = funCallBack;
	m_xfRead.pContext    = pContext;

	return DD_ERR_SUCCESS;
}
int DDSvrNetCfg::RegfrCloseCallBack(SvrNetfrCloseCBFun funCallBack,void *pContext)
{
	m_xfrClose.funCallBack = funCallBack;
	m_xfrClose.pContext    = pContext;

	return DD_ERR_SUCCESS;
}
